package com.yanu.t2s.controller;

import com.yanu.t2s.entity.Tuzai;
import com.yanu.t2s.service.TuzaiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("tuzai")
public class TuzaiController {
    @Autowired
    TuzaiService tuzaiService;
    @GetMapping("get/{id_tuzai}")
    public Tuzai findByIdTuzai(@PathVariable int id_tuzai) {
        return tuzaiService.findByIdTuzai(id_tuzai);
    }
    @GetMapping("get/all")
    public List<Tuzai> findAllTuzai() {
        return tuzaiService.findAllTuzai();
    }
}
